<link rel="stylesheet" href="/styles/thickbox.css" />
<script type="text/javascript" src="/scripts/thickbox.js"></script>
<table border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td valign="top"><div class="Col">
	<tal:block tal:content="structure php: this.partial('myactivity/myactivity.html')"/>
	</div>
	</td>
	<td valign="top"><div class="Col">
<div class="ModuleBlock">
<h1>
<label>Photos</label>
<div><a href="/album/settings/album-settings"  ><img src="/images/SettingsIcon.png" border="0" alt="Settings" title="Settings" align="top" class="SetIcon"/></a>
<a id="create" href="javascript:void(0);" onclick="createAlbum();"><img src="/images/CreateAddIcon.png" alt="Create" width="15" height="15"  border="0"  align="top" class="SetIcon" title="Create"/></a>
<a href="#"><img src="/images/pie-chartIcon.png" alt="Activity Summary" width="14" height="14"  border="0"  align="top" class="SetIcon" title="Activity Summary"/></a></div>
<div class="wid186"><input type="text" name="search" id="search" value="" onChange="getFilteredAlbums()" /><a href="javascript:void(0);"><img onclick="getFilteredAlbums()" src="/images/ModSearchIcon.png" border="0" class="SerImg" /></a></div>
</h1>
<div class="clear"></div>
<ul class="ModuleMenu">
<li><a href="/album/index/all">Albums</a> </li>
<li><a href="/album/photos/all" class="active">Photos</a> </li>
</ul>
<div style="float:right;padding-right:15px;">
	<select class='select_fl_b1' id='albumFilter' name="albumFilter" onchange='getFilteredAlbums()'> 
		<option value='2'>My Photos</option>
		<option value='4'>Shared to me</option>
	</select>
</div>
<div class="clear hig20"></div>
<div class="ModuleHig">
<div id="listAlbums">
	<?php if(is_array($ctx->getPhotos['result']) && count($ctx->getPhotos['result'])>0) { ?>
	<tal:block tal:content="structure php: this.partial('/photos/share-list.html')"/>
	<? } else { ?>
	<p style="padding:50px 50px"><b><center>you don't have personal photos</center></b></p>
	<? } ?>
</div>
<div class="clear"></div>
</div>
<div id="downPagerId1" class="paginat" style="padding-right:15px;"></div><div class="clear"></div>
</div>
</div></td>
	<td valign="top"><div class="Col">
<tal:block tal:omit-tag="" tal:content="structure php: this.action('photo-activity','activity','album')" />
</div></td>
<td valign="top">
<div class="ColBanner">
<div class="ModuleBlock">
<img src="/images/Gads.gif" /><img src="/images/Gads.gif" /></div>
</div></td>
  </tr>
</table>
<!-- Chat Window  -->
<div class="Chatbox">
<div class="Fleft pad_t2"><img src="/images/ChatAviIcon.png" /></div>
<div class="Fleft fontWht pad_115"><strong>Harinath</strong></div>
<div class="Fright"><a href="#" class="ChatBt"><strong>X</strong></a></div>
<div class="Fright"><a href="#" class="ChatBt txt18"><strong>-</strong></a></div>
</div>
<script type="text/javascript">
//<![CDATA[

	pagination1 = new Array();
	pagination1['currentPage'] = "<?=$ctx->getPhotos['currentPage']?>";
	pagination1['resultsPerPage'] = "<?=$ctx->getPhotos['resultPerPage']?>";
	pagination1['pages'] = "<?= $ctx->getPhotos['pages']?>";  
	pagination1['pager'] = '<?=$ctx->getPhotos["pager"]?>';
	pagination1['resultsCount'] = "${getPhotos/resultsCount}" ;
	
	var Params='${params}';
	var ParamsDup='';
	//alert(pagination['resultsCount']+'  '+Params);
	var requestUrlDup = "/album/photos/pagination/<?php echo $ctx->type; ?>/";
	//var requestUrlDup = "/user/myhome/ajax-news/0/";
	$(document).ready(function () {
	   setPagination1(pagination1['resultsCount'],'','downPagerId1','','');
	});
function showDiv(type)
{
	if(type == 'r')
	{
		$('#rec').addClass("active");
		$('#sent').removeClass("active");
		$('#sentId').hide();
		$('#recId').show();
	} else {
		//alert(type);
		$('#rec').removeClass("active");
		$('#sent').addClass("active");
		$('#sentId').show();
		$('#recId').hide();
	}

}
function createAlbum()
{
	tb_show('Add Photos','/album/index/create-album?&height=400&width=600','');
}
function shareAlbum(album_id,type)
{
	tb_show('Share Album','/album/index/create-album?&album_id='+photo_id+'&type='+type+'&height=400&width=600','');
}

function changeStatustoClose(val)
{
	//alert(val);return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "val="+val,
			    url: "/album/photos/delete-album/",
			    success: function(data){
					//location.reload();
					getFilteredAlbums();
				}
			});
}
function changeStatusFavorite(photo_id,status)
{
	//alert(album_id+"and"+status);return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "photo_id="+photo_id+"&status="+status+"&type=photos",
			    url: "/album/photos/favorite/",
			    success: function(data){
					getFilteredAlbums();
					//location.reload();					
				}
			});
}
function getFilteredAlbums(){
	//$("#newsFrm").submit();
	var filter = $('#albumFilter').val();
	var search_key_val = $('#search').val();
	$.ajax({
			type: "POST",
			dataType: "json",
			url: "/album/photos/all",
			data: {filter: filter,search_key:search_key_val},
			success: function(data){
				$('#listAlbums').html(data.output);
				pagination1['pages'] = data.pages;
			    pagination1['pager'] = data.pager;
			    pagination1['currentPage'] = data.currentPage;
			    pagination1['resultsDetails'] = data.resultsDetails;
			    setPagination1(data.resultsCount,'topPagerId1','downPagerId1',"topdet","botdet"); 
			}
		});
}
function deletePhoto(photo_id,photo_diffid,is_owner)
{
	//alert(photo_id+"and"+photo_diffid+"and"+is_owner);return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "photo_id="+photo_id+"&photo_diffid="+photo_diffid+"&is_owner="+is_owner,
			    url: "/album/photos/deleteshared-photos/",
			    success: function(data){
					//location.reload();					
					getFilteredAlbums();
				}
			});
}
function navigate(e) {
   
if(e.keyCode == 13)
{	
	//var comment=$("#comment");			  //enter pressed
     //submitComment(comment);
	 }
  }
  
document.onkeypress=navigate;

//]]>
</script>